package com.ruoyi.crm.controller.record;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.crm.domain.dto.BusinessDTO;
import com.ruoyi.crm.service.IBusinessService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * @author mr.huang [jie88888822@163.com]
 * @devTime 2022-06-23
 */
@Slf4j
@RestController
@RequestMapping("/business")
public class BusinessRecordController extends BaseController {
	@Resource
	private IBusinessService iBusinessService;

	/**
	 * 根据ID 查询出Mongo中商机的操作信息
	 * @param businessId
	 * @return
	 */
	@GetMapping("/record/list")
	public AjaxResult businessRecordData(Long businessId){
		return AjaxResult.success(iBusinessService.businessRecordData(businessId));
	}

	@PostMapping("/record")
	public AjaxResult addRecord(@RequestBody BusinessDTO busines){
		iBusinessService.addRecord(busines);
		return AjaxResult.success();
	}
}
